<div id="a_cont">
<div id="a_content">

	{if $question}
		<h3>Question</h3>
		{$question->articleData}
	{/if}
	<h1>{$article->title}</h1>
	{$article->articleData}

	<hr/>

	<h3>Comments</h3>
	<ul id="acomments">
	{foreach from=$comment item=c}
		<li><h4><a name="vc{$c.FileID}"></a>{$c.Title}</h4><p>{$c.Articledata}</p></li>
	{foreachelse}
	<span class="i">No Comments</span>
	{/foreach}
	</ul>

	<h3>Submit a Comment</h3>
	<a name="comment"></a>
	<form method="post">
		<p>Submit a comment in response to the knowledgebase article. The comments  may be modified by the Knowledgebase Administrator.<br/> Before
		posting the comment will be reviewed and may be edited for brevity, structure and content.</p>

		<p>Title:<br />
		<input type="text" name="commenttitle" size="40" maxlength="60" value="{if isset($smarty.post.commenttitle)}{$smarty.post.commenttitle}{else}re: {$article->title}{/if}" /></p>

		<p>Comment Text:<br />
		<textarea name="commenttext" style="width: 30em; height: 8em;">{if isset($smarty.post.commenttext)}{$smarty.post.commenttext}{/if}</textarea></p>

		<p><input type="submit" name="submit" value="Submit" /> <input type="reset" Value="Clear All" /></p>
	</form>

</div>

<div id="a_sidebar">

	{if isset($user) && ( $user->isAdmin || $user->id == $article->AuthorID)}
	<div class="row">
		<div>
			<h4>Author Tools</h4>
			<ul>
				<li><a href="saa.php?fileid={$article->id}">Edit</a></li>
				<li><a href="v.php?a={$article->id}&delreq=true">Delete</a></li>
			</ul>
		</div>
	</div>
	{/if}

	{if count($attach) > 0 || count($related) >0}
		<div class="row"><div>{if count($attach) > 0}
			<h4>Attachments</h4>
			<ul>
			{foreach from=$attach item=a}
				<li>
					<a href="attach/{$a.UploadID}-{$a.AuthorID}-{$a.FileID}-{$a.FileName}">{$a.FileDescription}</a>
					{if isset($user) && ( $user->isAdmin || $user->id == $article->AuthorID)}
					&nbsp;&nbsp; [<a href="v.php?a={$article->id}&delattachreq={$a.UploadID}">Delete</a>]
					{/if}
				</li>
			{/foreach}
			</ul>
		{/if}</div></div>
		<div class="Row"><div>{if count($related) >0}
			<h4>Related</h4>
			<ul>
			{foreach from=$related item=r}
				<li><a href="v.php?a={$r.FileID}">{$r.Title}</a></li>
			{/foreach}
			</ul>
		{/if}</div></div>
	{/if}

		<div class="row">
			<div>
				<h4>Ratings</h4>
				{if isset($smarty.post.score)}You rated this article {$smarty.post.score}<br/><br/>{/if}
				{if isset($smarty.post.score) || ( isset($user) && $article->authorID == $user->id )}
				<span class="b">Average: {if $article->ratedCount > 0}{$article->rating / $article->ratedCount}{else}0{/if}</span>
				{else}
					<form method="post">
						<input type="radio" name="score" value="5" /><img src="./imgs/star.gif" height="10" width="10" /><img src="./imgs/star.gif" height="10" width="10" /><img src="./imgs/star.gif" height="10" width="10" /><img src="./imgs/star.gif" height="10" width="10" /><img src="./imgs/star.gif" height="10" width="10" /><br/>
						<input type="radio" name="score" value="4" /><img src="./imgs/star.gif" height="10" width="10" /><img src="./imgs/star.gif" height="10" width="10" /><img src="./imgs/star.gif" height="10" width="10" /><img src="./imgs/star.gif" height="10" width="10" /><br/>
						<input type="radio" name="score" value="3" /><img src="./imgs/star.gif" height="10" width="10" /><img src="./imgs/star.gif" height="10" width="10" /><img src="./imgs/star.gif" height="10" width="10" /><br/>
						<input type="radio" name="score" value="2" /><img src="./imgs/star.gif" height="10" width="10" /><img src="./imgs/star.gif" height="10" width="10" /><br/>
						<input type="radio" name="score" value="1" /><img src="./imgs/star.gif" height="10" width="10" /><br/>
						&nbsp;&nbsp;<input type=submit name="submit" value="Submit Rating">
					</form>
				{/if}
			</div>
		</div>
		{if $pluginpdf == 1}
		<div class="row">
			<div>
				<h4>Export</h4>

				<form action="plugins/pdfClasses/pdfgen.php" method="POST">
				<input type="hidden" name="pdfa" value="{$article->id}" />
				Generate a <input type="submit" class="submitLink" value="PDF" />
				</form>

			</div>
		</div>
		{/if}
		<div class="row">
			<h4>Article Details</h4>
			<div class="a_details">
				<span>FileID</span>:  		{$article->id}<br />
				<span>Approved</span>:		{$article->approved}<br/>
				<span>Keywords</span>:		{$article->keywords}<br />
				<span>Authored by</span>:	{if $author}{$author->nameFirst} {$author->nameLast}{else}Guest Author{/if}<br />
				<span>Views</span>:			{$article->views}<br />
				<span>Rating Total</span>:	{$article->rating}<br />
				<span>Rated Count</span>:	{$article->ratedCount}<br />
				<span>Submit Date</span>:	{$article->dateSubmitted}<br />
			</div>
		</div>
		<br style="clear: both;"/>
	</div>
</div>
<br class="clear"/>
</div>